package org.nlp2rdf.navigator.client.common;

import java.io.Serializable;

/**
 * This object should tell the GUI, how to behave: searchId = a unique identifer
 * searchtype = a string, which determines, if for example a text input field is
 * shown label = additional string for the GUI to display
 * 
 * @author Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
 * 
 */
@SuppressWarnings("serial")
public class SearchDescriptorDTO implements Serializable {
	private String searchId;
	private String searchType;
	private String label;
	private String comment;

	public void setSearchId(String searchId) {
		this.searchId = searchId;
	}

	public void setSearchType(String searchType) {
		this.searchType = searchType;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	@Override
	public String toString() {
		return searchId + "|" + searchType + "|" + label;
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof SearchDescriptorDTO) {
			SearchDescriptorDTO od = (SearchDescriptorDTO) o;
			return od.searchId.equals(searchId);
		}
		return false;
	}

	@Override
	public int hashCode() {
		return searchId.hashCode();
	}

	public String getSearchId() {
		return searchId;
	}

	public String getSearchType() {
		return searchType;
	}

	public String getLabel() {
		return label;
	}

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }
}
